package com.itzb.asone.system.service.impl;


import java.util.List;

import com.itzb.asone.mybatis.Criteria;
import com.itzb.asone.system.model.SysOrg;
import com.itzb.asone.system.repository.ISysOrgRepository;
import com.itzb.asone.system.service.IMessageService;
import com.itzb.asone.system.service.ISysOrgService;

public class SysOrgServiceImpl implements ISysOrgService{
	
	private ISysOrgRepository sysOrgRepository;
	private IMessageService messageService;

	public List<SysOrg> queryPage(Criteria<SysOrg> param){
		return sysOrgRepository.queryPage(param);
	}

	public SysOrg queryOrgByOrgCode(String orgCode){
		Criteria<SysOrg> param = new Criteria<SysOrg>();
		param.addParam("orgCode", orgCode);
		List<SysOrg> list = this.queryPage(param);
		SysOrg sysOrg = new SysOrg();
		if(list != null || list.size() >= 0){
			sysOrg = list.get(0);
		}
		return sysOrg;
		
	}
	public Integer queryPageCount(Criteria<SysOrg> param){
		return sysOrgRepository.queryPageCount(param);
	}

	public SysOrg queryEntityById(String id){
		return sysOrgRepository.queryEntityById(id);
	}

	public Integer insert(SysOrg record){
		return sysOrgRepository.insert(record);
	}

	public Integer updateByCriteria(Criteria<SysOrg> param){
		return sysOrgRepository.updateByCriteria(param);
	}

	public Integer deleteById(String id){
		return sysOrgRepository.deleteById(id);
	}

	public Integer deleteByCriteria(Criteria<SysOrg> param){
		return sysOrgRepository.deleteByCriteria(param);
	}

	public ISysOrgRepository getSysOrgRepository() {
		return sysOrgRepository;
	}

	public void setSysOrgRepository(ISysOrgRepository sysOrgRepository) {
		this.sysOrgRepository = sysOrgRepository;
	}

	public IMessageService getMessageService() {
		return messageService;
	}

	public void setMessageService(IMessageService messageService) {
		this.messageService = messageService;
	}

	
}
